Ext.define('appmod.view.resources.MenuResForm', {
    extend: 'Ext.form.Panel',
	alias: 'widget.menuresourceform',
	bodyPadding: 10,

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            items: [
                {
                    xtype: 'textfield',
                    fieldLabel: '菜单编码',
					name: 'code',
					labelWidth: 80,
                    anchor: '100%'
                },
                {
                    xtype: 'hiddenfield',
                    name: 'idSysRes',
                    anchor: '100%'
                },
                {
                    xtype: 'textfield',
                    fieldLabel: '菜单名称',
					name : 'name',
					labelWidth: 80,
                    anchor: '100%'
                },
                {
                    xtype: 'combobox',
                    fieldLabel: '所属模块',
					editable : false,
					displayField:'name',
					valueField:'value',
					store : 'resources.RegisterModuleSelStore',
					name:'moduleId',
					queryMode : 'local',					
					labelWidth: 80,
                    anchor: '50%'
                },
                {
                    xtype: 'fieldset',
                    layout: {
                        type: 'hbox'
                    },
					defaults: {
						 anchor: '100%',
						 margins:'0 5 0 0'
					},
                    title: '父 级',
					height : 60,
                    items: [
                        {
							fieldLabel: '选择菜单名',
                            xtype: 'textfield',
							name : 'parentName',
							readOnly:true
                        },
                		{
                    		xtype: 'hiddenfield',
                    		name: 'parentId',
                    		anchor: '100%'
                		},						
                        {
                            xtype: 'button',
                            text: '指 定',
							action:'selectParentMenu'
                        },
						{
                            xtype: 'button',
                            text: '清 除',
							action:'clearParentMenu'
                        }
                    ]
                },
                {
                    xtype: 'radiogroup',
                    fieldLabel: '禁 用',
                    anchor: '100%',
                    items: [
                        {
                            xtype: 'radiofield',
                            boxLabel: '可用',
                            checked: true,
							inputValue:0,
							name:'disabled'
                        },
                        {
                            xtype: 'radiofield',
							inputValue:1,
							name:'disabled',
                            boxLabel: '禁用'
							
                        }
                    ]
                }
            ],
			buttons: [{
            		text: '保 存',
					action:'save'
        			},{
            	text: '重 置',
				action:'reset'
        		}
			]
        });

        me.callParent(arguments);
    }
});